// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_HR_LEAVE_APPLICATION
// * CreateDate    : 2014-06-05 18:30:04
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:04
// * LastChanger   : 2014-06-05 18:30:04
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class HrLeaveApplicationEntity : EntityBase
    {
        public HrLeaveApplicationTable TableSchema
        {
            get
            {
                return HrLeaveApplicationTable.Current;
            }
		}
		
		public HrLeaveApplicationEntity()
        {

        }
		
		public HrLeaveApplicationEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.ApplicationId = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_ID"]));
			this.LeaveType = Convert.ToString(CommonFunctions.ToObject(dr["LEAVE_TYPE"]));
			this.DepartmentId = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_ID"]));
			this.PositioinId = Convert.ToString(CommonFunctions.ToObject(dr["POSITIOIN_ID"]));
			this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
			this.ApplicationDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPLICATION_DATE"]));
			this.StartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_DATE"]));
			this.EndDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["END_DATE"]));
			this.DayCount = Convert.ToDecimal(CommonFunctions.ToObject(dr["DAY_COUNT"]));
			this.LeaveReason = Convert.ToString(CommonFunctions.ToObject(dr["LEAVE_REASON"]));
			this.DmRemark = Convert.ToString(CommonFunctions.ToObject(dr["DM_REMARK"]));
			this.DmPerson = Convert.ToString(CommonFunctions.ToObject(dr["DM_PERSON"]));
			this.DmApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DM_APPROVED_DATE"]));
			this.CeoRemark = Convert.ToString(CommonFunctions.ToObject(dr["CEO_REMARK"]));
			this.CeoPerson = Convert.ToString(CommonFunctions.ToObject(dr["CEO_PERSON"]));
			this.CeoApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CEO_APPROVED_DATE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
			this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
        }
		
		public HrLeaveApplicationEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.ApplicationId = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_ID"]));
			this.LeaveType = Convert.ToString(CommonFunctions.ToObject(dr["LEAVE_TYPE"]));
			this.DepartmentId = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_ID"]));
			this.PositioinId = Convert.ToString(CommonFunctions.ToObject(dr["POSITIOIN_ID"]));
			this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
			this.ApplicationDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPLICATION_DATE"]));
			this.StartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_DATE"]));
			this.EndDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["END_DATE"]));
			this.DayCount = Convert.ToDecimal(CommonFunctions.ToObject(dr["DAY_COUNT"]));
			this.LeaveReason = Convert.ToString(CommonFunctions.ToObject(dr["LEAVE_REASON"]));
			this.DmRemark = Convert.ToString(CommonFunctions.ToObject(dr["DM_REMARK"]));
			this.DmPerson = Convert.ToString(CommonFunctions.ToObject(dr["DM_PERSON"]));
			this.DmApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DM_APPROVED_DATE"]));
			this.CeoRemark = Convert.ToString(CommonFunctions.ToObject(dr["CEO_REMARK"]));
			this.CeoPerson = Convert.ToString(CommonFunctions.ToObject(dr["CEO_PERSON"]));
			this.CeoApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CEO_APPROVED_DATE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
			this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return HrLeaveApplicationTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string ApplicationId
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_APPLICATION_ID)); }
            set { SetData(HrLeaveApplicationTable.C_APPLICATION_ID, value); }
        }
		
        [DataMember]
        public string LeaveType
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_LEAVE_TYPE)); }
            set { SetData(HrLeaveApplicationTable.C_LEAVE_TYPE, value); }
        }
		
        [DataMember]
        public string DepartmentId
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_DEPARTMENT_ID)); }
            set { SetData(HrLeaveApplicationTable.C_DEPARTMENT_ID, value); }
        }
		
        [DataMember]
        public string PositioinId
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_POSITIOIN_ID)); }
            set { SetData(HrLeaveApplicationTable.C_POSITIOIN_ID, value); }
        }
		
        [DataMember]
        public string PersonId
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_PERSON_ID)); }
            set { SetData(HrLeaveApplicationTable.C_PERSON_ID, value); }
        }
		
        [DataMember]
        public DateTime ApplicationDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_APPLICATION_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_APPLICATION_DATE, value); }
        }
		
        [DataMember]
        public DateTime StartDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_START_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_START_DATE, value); }
        }
		
        [DataMember]
        public DateTime EndDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_END_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_END_DATE, value); }
        }
		
        [DataMember]
        public decimal DayCount
        {
            get { return Convert.ToDecimal(GetData(HrLeaveApplicationTable.C_DAY_COUNT)); }
            set { SetData(HrLeaveApplicationTable.C_DAY_COUNT, value); }
        }
		
        [DataMember]
        public string LeaveReason
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_LEAVE_REASON)); }
            set { SetData(HrLeaveApplicationTable.C_LEAVE_REASON, value); }
        }
		
        [DataMember]
        public string DmRemark
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_DM_REMARK)); }
            set { SetData(HrLeaveApplicationTable.C_DM_REMARK, value); }
        }
		
        [DataMember]
        public string DmPerson
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_DM_PERSON)); }
            set { SetData(HrLeaveApplicationTable.C_DM_PERSON, value); }
        }
		
        [DataMember]
        public DateTime DmApprovedDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_DM_APPROVED_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_DM_APPROVED_DATE, value); }
        }
		
        [DataMember]
        public string CeoRemark
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_CEO_REMARK)); }
            set { SetData(HrLeaveApplicationTable.C_CEO_REMARK, value); }
        }
		
        [DataMember]
        public string CeoPerson
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_CEO_PERSON)); }
            set { SetData(HrLeaveApplicationTable.C_CEO_PERSON, value); }
        }
		
        [DataMember]
        public DateTime CeoApprovedDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_CEO_APPROVED_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_CEO_APPROVED_DATE, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_STATUS)); }
            set { SetData(HrLeaveApplicationTable.C_STATUS, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_CREATED_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_CREATED_BY)); }
            set { SetData(HrLeaveApplicationTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime LastModifiedDate
        {
            get { return Convert.ToDateTime(GetData(HrLeaveApplicationTable.C_LAST_MODIFIED_DATE)); }
            set { SetData(HrLeaveApplicationTable.C_LAST_MODIFIED_DATE, value); }
        }
		
        [DataMember]
        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(HrLeaveApplicationTable.C_LAST_MODIFIED_BY)); }
            set { SetData(HrLeaveApplicationTable.C_LAST_MODIFIED_BY, value); }
        }
		
		#endregion
	}
	
	
}	

